home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / utilitys / ed3_1_1 / part01 next >
Encoding:
Internet Message Format  |  1991-11-07  |  42.2 KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i172: ED3 1.1 - a primitive 3D editor for use with NU3, Part01/06
  4. Reply-To: rodent@netcom.com (Ben Discoe)
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga.v91i172@ab20.larc.nasa.gov>
  7. Date: 07 Nov 91 15:54:08 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga.misc
  11.  
  12. Submitted-by: rodent@netcom.com (Ben Discoe)
  13. Posting-number: Volume 91, Issue 172
  14. Archive-name: utilities/ed3-1.1/part01
  15.  
  16. ED3, a primitive 3D editor for use with NU3, a primitive 3D viewer.
  17. This is version 1.1, the 1st real release.  There is a lot of work left to do.
  18.  
  19. The main purpose of this program is to play with polyhedra and "geodesic"
  20. structures.  However, it is very general-purpose so you could use it for any
  21. sort of 3D world-design. 
  22.  
  23. #!/bin/sh
  24. # This is a shell archive.  Remove anything before this line, then unpack
  25. # it by saving it into a file and typing "sh file".  To overwrite existing
  26. # files, type "sh file -c".  You can also feed this as standard input via
  27. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  28. # will see the following message at the end:
  29. #        "End of archive 1 (of 6)."
  30. # Contents:  create.p ed3.h ed3.readme ed3.tech eded.p edgr.p edio.p
  31. #   edsysdef.h edtypes.h edvan.p freq.p sysdefed.h sysgr.h sysgr.p
  32. #   sysnogr.h undo.p
  33. # Wrapped by tadguy@ab20 on Thu Nov  7 10:53:51 1991
  34. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  35. if test -f 'create.p' -a "${1}" != "-c" ; then 
  36.   echo shar: Will not clobber existing file \"'create.p'\"
  37. else
  38. echo shar: Extracting \"'create.p'\" \(471 characters\)
  39. sed "s/^X//" >'create.p' <<'END_OF_FILE'
  40. X/* Prototypes for functions defined in create.c */
  41. Xvoid create_poly(int which_poly);
  42. Xvoid create_tetra(int connected);
  43. Xvoid create_octa(int connected);
  44. Xvoid create_cube(int connected);
  45. Xvoid create_icosa(int connected);
  46. Xvoid create_dodec(int connected);
  47. Xvoid create_rhombic(int connected);
  48. Xvoid create_cuboct(int connected);
  49. Xvoid create_globe(void);
  50. Xvoid create_globe0(coord radius,
  51. X                   int phi_div,
  52. X                   int theta_div);
  53. Xvoid normalize(void);
  54. END_OF_FILE
  55. if test 471 -ne `wc -c <'create.p'`; then
  56.     echo shar: \"'create.p'\" unpacked with wrong size!
  57. fi
  58. # end of 'create.p'
  59. fi
  60. if test -f 'ed3.h' -a "${1}" != "-c" ; then 
  61.   echo shar: Will not clobber existing file \"'ed3.h'\"
  62. else
  63. echo shar: Extracting \"'ed3.h'\" \(6803 characters\)
  64. sed "s/^X//" >'ed3.h' <<'END_OF_FILE'
  65. X/*
  66. X    Include file for all modules of the 3d editor.
  67. X    Important global stuff.
  68. X
  69. X09-02-91 added pselected, ploose
  70. X08-28-91 added MAX_EDGES
  71. X08-24-91 moved Gadget IDs to edgr.c
  72. X08-23-91 moved Menu IDs to sysgr.c
  73. X         moved many flags into a new "Flags" structure
  74. X*/
  75. X
  76. X#define INTEGER 1
  77. X
  78. X#define MAX_EDGES    20    /* The most edges any polygon is allowed to have */
  79. X#define OPERATIONS    100    /* max */
  80. X#define ACTIONBUF    300    /* action buffer size */
  81. X#define REFRESH_LEVEL 100 /* If there are less then REFRESH_LEVEL facets on
  82. Xthe screen, undo, redo and and move_points will do a full refresh to keep the
  83. Xdisplay clean.  Obviously we don't ALWAYS want to do a full refresh if the
  84. Xobject has many hundreds of facets */
  85. X
  86. X#include "sysdefed.h"    /* system-specific definitions */
  87. X#include "edtypes.h"    /* typedefs */
  88. X
  89. X#if PROTOS
  90. X#include "create.p"    /* include prototypes */
  91. X#include "edgr.p"
  92. X#include "eded.p"
  93. X#include "sysgr.p"
  94. X#include "edio.p"
  95. X#include "edvan.p"
  96. X#include "freq.p"
  97. X#include "undo.p"
  98. X#endif
  99. X
  100. X#define FILE_EXT    ".3d"
  101. X#define GADX        90        /* width of gadget boxes */
  102. X#define edit_minx GADX+1    /* bounds of editing area */
  103. X/* edit_miny is a variable based on the size of the title bar */
  104. X
  105. X/* gadget IDs */
  106. X#define GID_ADD        1
  107. X#define GID_DELETE    2
  108. X#define GID_SELECTOR    3
  109. X#define GID_MOVE    4
  110. X#define GID_FACE    5
  111. X#define GID_POLY    6
  112. X#define GID_MORE    7
  113. X#define GID_DEFACE    8
  114. X#define GID_DEPOLY    9
  115. X#define GID_MORE2    10
  116. X#define GID_ROTATE    11
  117. X#define GID_ROTP    12
  118. X#define GID_ZOOM    13
  119. X#define GID_DIST    14
  120. X#define GID_GLUE    15
  121. X#define GID_UNDO    16
  122. X#define GID_REDO    17
  123. X#define GID_XY        18
  124. X#define GID_XZ        19
  125. X#define GID_ZY        20
  126. X#define GID_3D        21
  127. X#define GID_color1    22
  128. X#define GID_color2    23
  129. X#define GID_color3    24
  130. X
  131. X/* editing modes */
  132. X#define M_ADDP    0    /* add point */
  133. X#define M_DELP    1    /* delete point */
  134. X#define M_SELE    2    /* select/deselect points */
  135. X#define M_MOVP    3    /* move point */
  136. X#define M_FACE    4    /* start a new face */
  137. X#define M_POLY    5    /* start a new face */
  138. X#define M_MORE    6    /* designate another point of the face or poly to create */
  139. X#define M_DEFA    7    /* remove a face */
  140. X#define M_DEPO    8    /* remove a poly */
  141. X#define M_KMORE    9    /* designate another point of the face or poly to remove */
  142. X#define M_ROTA    10    /* rotate around third dimension: place axis */
  143. X#define M_ROTP    11    /* rotate around third dimension: move the points */
  144. X#define M_ZOOM    12    /* zoom in/out */
  145. X#define M_DIST    13    /* adjust distance tool */
  146. X#define M_GLUE    14    /* glue two points together (fuse into one point) */
  147. X
  148. X/* display modes */
  149. X#define DM_XY    0    /* three 2D display modes */
  150. X#define DM_XZ    1
  151. X#define DM_ZY    2
  152. X#define DM_3D    3    /* 3D view mode, unimplemented */
  153. X
  154. X/* Toggleable menu item numbers */
  155. X#define MI_ASSUME_POLY    0
  156. X#define MI_COORDS        1
  157. X#define MI_CROSSHAIR    2
  158. X#define MI_DISTANCETOOL    3
  159. X#define MI_ROTATEALL    4
  160. X#define MI_UNDOBUF        5
  161. X#define MI_UNDOBUFSIZE    6
  162. X
  163. X/* error codes */
  164. X#define OKAY            0
  165. X#define ERR_NOTHING        1    /* nothing was there */
  166. X#define ERR_CANTOPEN    2    /* can't open a file */
  167. X#define ERR_NOTED3        3    /* not an ED3 file */
  168. X#define ERR_NOMEM        4    /* not enough memory for operation */
  169. X#define ERR_NOMEM_POINT    5    /* not enough memory for more points */
  170. X#define ERR_NOMEM_FACE    6    /* not enough memory for more faces */
  171. X#define ERR_NOMEM_POLY    7    /* not enough memory for more polygons */
  172. X#define ERR_BADFACE        8    /* face refers to a non-existent point */
  173. X#define ERR_SYS            9
  174. X#define ERRORS            10
  175. X
  176. X/* Menu options */
  177. X#define MO_NOTENABLED    1
  178. X#define MO_TOGGLE        2    /* allow user to toggle w/checkmark */
  179. X#define MO_CHECKED        4    /* checked at creation time */
  180. X
  181. X/* Gadget flags */
  182. X#define GF_NOSELECT        1    /* this gadget should not be selectable */
  183. X
  184. X/* display flags */
  185. X#define DF_WORKBENCH    1
  186. X#define DF_MED_RES        2
  187. X#define DF_SYS_PALETTE    4    /* use the system (in this case workbench) palette */
  188. X
  189. X/* mouse flags */
  190. X#define MF_DOUBLE    2
  191. X#define MF_SHIFTED    4
  192. X
  193. X/* action types */
  194. X#define AT_ADD_P    1    /* add point */
  195. X#define AT_DEL_P    2    /* del point */
  196. X#define AT_ADD_F    3    /* add face */
  197. X#define AT_DEL_F    4    /* del face */
  198. X#define AT_ADD_Q    5    /* add polygon */
  199. X#define AT_DEL_Q    6    /* del polygon */
  200. X#define AT_MOVE_P    7    /* move point */
  201. X#define AT_JOIN_P    8    /* join two points (replace one with another) */
  202. X#define AT_DEL_V    9    /* delete vertex */
  203. X#define AT_MORPH_Q    10    /* degenerate a polygon into a face */
  204. X
  205. X/* polyhedron numbers */
  206. X#define POLY_TET    0
  207. X#define POLY_OCT    1
  208. X#define POLY_CUBE    2
  209. X#define POLY_ICOS    3
  210. X#define POLY_DODEC    4
  211. X#define POLY_RHOMB    5
  212. X#define POLY_CUBOCT    6
  213. X
  214. X/* point flags: in the code field of EdPoint (below) */
  215. X#define PF_LOOSE    (1 << 14)
  216. X#define PF_SELECTED    (1 << 15)
  217. X#define PF_CLIP        0x000f    /* low four bits used for clipping info */
  218. X
  219. X#define EV_HITBUTTON    1    /* pressed a boolean gadget */
  220. X#define EV_HITRETURN    2    /* hit return in a long_int gadget */
  221. X#define EV_CHECKINT        3
  222. X#define EV_CANCEL        4    /* like, if the user closes the window */
  223. X
  224. X/* point macros */
  225. X#define pselected(p)    (point[p].code & PF_SELECTED)
  226. X#define ploose(p)        (point[p].code & PF_LOOSE)
  227. X#define off_screen(p)    (point[p].code & PF_CLIP)
  228. X
  229. X/* an unused value returned by ShowGetLong to signal cancellation */
  230. X#define SGL_CANCEL -69696969    /* orgy */
  231. X
  232. X#ifdef DEFINE_GLOBALS
  233. X# define vextern
  234. X#else
  235. X# define vextern extern
  236. X#endif
  237. X
  238. X/******* global variables *******/
  239. X
  240. X/* pointers to the complete set of 3D points and faces */
  241. Xvextern EdPoint *point;
  242. Xvextern Face *face;
  243. Xvextern Polygon *poly;
  244. Xvextern EndPoint dtool_end[2];    /* the ends of the distance tool line segment */
  245. Xvextern Flags flags;
  246. Xvextern Colors colors;
  247. X
  248. Xvextern short *select_p;    /* array of selected points */
  249. X
  250. X/* temporary: remember the points when creating a new polygon */
  251. Xvextern unsigned short temp_poly[20];
  252. X
  253. Xvextern unsigned short MAX_POINTS, MAX_FACES, MAX_SELECT, MAX_POLYS;
  254. Xvextern unsigned short points, faces, polys, selected;
  255. Xvextern unsigned short new_seg, first_point, last_point;
  256. X
  257. Xvextern Point3D axis;        /* point around which we rotate */
  258. Xvextern Point3D point0;        /* always 0 */
  259. Xvextern Vector3D movement;    /* the direction we drag the points */
  260. Xvextern Vector3D offset;    /* current viewing offset */
  261. Xvextern Vector3D vector0;    /* always 0 */
  262. X
  263. X/* Please Forgive Me for Using Short Names for some Global Variables */
  264. X
  265. Xvextern coord gx, gy, gz;    /* global 3d cursor location */
  266. Xvextern short px, py,
  267. X          mx, my;        /* mouse location on screen */
  268. Xvextern char mode,        /* editing mode */    
  269. X         dmode;            /* display mode (XZ etc.)play mode (XZ etc. */
  270. X
  271. Xvextern short sxmax, symax;    /* flexible size of drawing area */
  272. Xvextern short x_center, y_center;
  273. Xvextern short edit_miny;
  274. X
  275. Xvextern double rot_angle;
  276. Xvextern double SCALE, distance;
  277. X
  278. Xvextern char title[80];        /* the message on the screen's title bar*/
  279. Xextern char *errstring[];
  280. X
  281. Xvextern action_bufsize, act_buf;    /* in-use vs. next time */
  282. Xvextern operation_bufsize, op_buf;
  283. X
  284. Xvextern Operation *operation;
  285. Xvextern char *action;
  286. X
  287. Xvextern changes;    /* number of operations given since last save */
  288. END_OF_FILE
  289. if test 6803 -ne `wc -c <'ed3.h'`; then
  290.     echo shar: \"'ed3.h'\" unpacked with wrong size!
  291. fi
  292. # end of 'ed3.h'
  293. fi
  294. if test -f 'ed3.readme' -a "${1}" != "-c" ; then 
  295.   echo shar: Will not clobber existing file \"'ed3.readme'\"
  296. else
  297. echo shar: Extracting \"'ed3.readme'\" \(9555 characters\)
  298. sed "s/^X//" >'ed3.readme' <<'END_OF_FILE'
  299. X
  300. X-------------------------------------------------------------------
  301. XED3, a primitive 3D editor for use with NU3, a primitive 3D viewer.
  302. X-------------------------------------------------------------------
  303. X
  304. XThis is version 1.1, the 1st real release.  There is a lot of work left to do.
  305. XThis version is placed in the public domain by it's author, Ben Discoe.
  306. XThe author is a firm believer in the hacker ethic.  Use at your own risk.  If
  307. Xyou like this program, use it, use pieces of its code, or even find it
  308. Xvaguely interesting, please let me know!
  309. X
  310. XThe main purpose of this program is to play with polyhedra and "geodesic"
  311. Xstructures.  However, it is very general-purpose so you could use it for any
  312. Xsort of 3D world-design.  The only other 3D editor I have ever used is the
  313. Xone in Sculpt-3D (back in 1987) so I don't know how they might compare to
  314. Xed3.  The files that ed3 loads and saves are not in any standard format,
  315. Xso you can't just load Sculpt, Imagine or Turbo Silver objects.
  316. X
  317. Xed3 can compile into a integer version or a floating-point version.  The
  318. Xfloating-point version is highly recommended for people with fast CPUs,
  319. Xmath coprocessors, or the need for high accuracy.
  320. X
  321. XBefore running: make sure you have the req.library in your LIBS:
  322. Xdirectory.  It's included in this archive case you don't have it already.
  323. X
  324. XThere's only one command line option: -w will start ed3 on your workbench
  325. Xscreen.  Sorry, Workbench fans, no ToolTypes stuff.
  326. X
  327. XI've just realized that the program has developed completely lacking
  328. Xdocumentation, so I'll now make a doomed attempt to at least notify you of
  329. Xwhat features are available:
  330. X
  331. X*****************************************************************************
  332. X
  333. X    G A D G E T S
  334. X
  335. XADD    Puts you in Add Point mode.  Click either button to add points.
  336. X
  337. XDELETE    Puts you in Delete Point mode.  Click to delete points - which
  338. X    button you use affects things - see below.
  339. X
  340. XSELECTOR This gives you the selector tool, which selects/deselects points.
  341. X    Double-click to select-connected (or deselect-connected).
  342. X
  343. XMOVE    Puts you in Move mode.  Click to select a point, shift-click to
  344. X    select more points.  Once the points are selected, you can drag
  345. X    to move them.
  346. X
  347. XFACE    Puts you in Add Face mode.  A Face in ED3 means a triangular face.
  348. X    In this mode, click on any three points to create a Face.
  349. X
  350. XPOLY    Puts you in Add Polygon mode.  A Polygon in ED3 means a polygon
  351. X    with more than 3 vertices.  This distinction between Faces and
  352. X    Polygons is important to programs that, for example, only
  353. X    support planar faces.
  354. X
  355. X(ADDP)    You are put in this mode when connecting points for a Face or
  356. X    Polygon.
  357. X
  358. XDEFACE    Lets you specify three points to remove a Face.
  359. X
  360. XDEFACE    Lets you specify N points to remove a Poly.
  361. X
  362. XROTATE    In Rotate mode, click once to specify the axis of rotation,
  363. X    then move the mouse around this point to the desired angle
  364. X    and click once more.  All points will rotate.
  365. X
  366. XZOOM    Lets you change the degree of magnification.  In Zoom mode, click
  367. X    the first button to zoom in towards a location, second button to
  368. X    zoom out away from a location.  Try it, it's one of my favorite
  369. X    features.
  370. X
  371. XDISTANCE The Distance tool is a "ruler" for measuring distance in 3D space.
  372. X    Both ends can be dragged around, or "attached" to points by
  373. X    double-clicking near the intended point.  The distance (length
  374. X    of the distance tool) appears in the upper right corner.
  375. X
  376. XGLUE    Glue will "merge" the the point closest to the pointer and the
  377. X    point closest to it.  All degenerations are handled correctly.
  378. X
  379. XUNDO    If you find a bug in Undo/Redo, let me know.  It's a fairly
  380. XREDO    tricky feature.  It's also fairly uncommon in 3d editors.
  381. X
  382. XXY, XZ, YZ    Specify the orthogonal direction of view.
  383. X
  384. X> 3D <    Currently, viewing your object from a 3D perspective requires
  385. X    a separate program, NU3, which supports several different
  386. X    hidden-line algorithms.  Someday this capability may merge
  387. X    with ED3.
  388. X
  389. XCOLOR gadgets.  These affect the color of the faces you define which is
  390. X    only displayed by the 3D viewer NU3.
  391. X
  392. X*****************************************************************************
  393. X
  394. X    M E N U S
  395. X
  396. XSince the right button is used to select points, the pointer must be over
  397. Xthe menu bar to access the menus.
  398. XMenu options:
  399. X
  400. XPROJECT Normal stuff.  "Save Defaults" saves the settings of the "Options"
  401. X    menu to a file called ed3-defs, which is automatically loaded the
  402. Xnext time you start.
  403. X
  404. XEDIT    No clipboard support yet.  The Duplicate menu makes an exact in-place
  405. X    copy of all selected points and the facets connecting them.  Erase
  406. Xkills the selected points and the facets connecting them.  The bottom three
  407. Xoptions aren't completely implemented.
  408. X
  409. XPOLYHEDRA    These are some basic polyhedra.  You can use them as
  410. X        starting points for constructing really wild, complex
  411. Xpolyhedra using the special features described below.
  412. X
  413. XSPECIAL
  414. X-------
  415. XFREQUENCY    This is one of the two Really Neat features of ED3.
  416. X        This will divide each triangular (or quadrilateral) face into
  417. Xa set of smaller triangles, where the number of resultant triangles is
  418. Xfrequency squared.  Try this on your favorite polyhedra, then Normalize to
  419. Xget pseudo-geodesic structures.  The reason why I say psuedo is because if
  420. Xyou use this method with any ODD frequency, the resulting location of
  421. Xvertices does not truly correlate to subdiving the geodesicic arcs described
  422. Xby the polyhefron edges.  It is, however, very close, close enough for a
  423. Xcrude program such as ED3.  You could theoretically raise a form to any large
  424. Xfrequency, although you are, naturally, limited by your memory size.
  425. X
  426. XFIND DUAL    This is the second Really Neat feature.
  427. X        Every fully-connected polyhedron has a dual, which is formed
  428. Xby exchanging the configuration of faces with vertices.  For example, the
  429. Xcube's dual is the octahedron, and the icosahedron's dual is the pentagon
  430. Xdodecahedon.  Complex geodesic structures also have their duals, which are
  431. Xtypically complex "fly's eye" structures involving many hexagons.  Naturally,
  432. Xa dual of a dual is the original shape.
  433. X
  434. XUNFOLD        This is a future Really Neat feature.
  435. X
  436. XNORMALIZE    This finds the center of all points and adjusts all points
  437. X        to lie the average distance from that center.  Simply stated,
  438. Xit makes all points Spherical.  Use to project flat tesselated faces onto
  439. Xtheir geodesics.
  440. X
  441. XSTELLATE    This will take every face and make a pyramid out of it,
  442. X        giving a "3D star" based on whatever shape you are using.
  443. XCombining this feature with "Find Dual" can be used to form truncated forms
  444. Xof polyhedra.  Try it.
  445. X
  446. XCENTER->ORIGIN    Moves all points so that their vector sum is centered on the
  447. X        origin.
  448. X
  449. XOPTIONS
  450. X-------
  451. XASSUME POLYHEDRON tell the features on the Special menu (notably Find Dual
  452. X        and Normalize) to assume that the shape you're working with
  453. X        is a polyhedron.  Set this option whenever you DO have a
  454. X        polyhedron.
  455. X
  456. XROTATE EVERYTHING tells the rotate command to rotate all points, not only
  457. X        the selected points.
  458. X
  459. XUNDO BUFFER ACTIVE turns the undo/redo buffer on or off.  If you playing with
  460. X        very large shapes or have little memory, you may want to
  461. X        turn this off.
  462. X
  463. XSET UNDO BUFFER SIZE will affect the undo buffer only at the next time you
  464. X        start ed3 - it doesn't change or damage your current undo
  465. X        buffer.
  466. X
  467. X
  468. X(A 3D CONVEX HULL algorithm is yet another future Really Neat feature)
  469. X
  470. X*****************************************************************************
  471. X
  472. XMore functionality available from the keyboard:
  473. X
  474. X  ESC    Quits.
  475. X    C    Toggles the crosshair.
  476. X    D    Toggles the distance tool.
  477. X    M    Same as the Move button.
  478. X    U    Same as Undo button.
  479. X    R    Same as Redo button.
  480. X8 and 2    The ED3 "pointer" really exists in 3 dimensions, as its location is
  481. X    displayed near the title bar.  8 and 2 (chosen for their location in
  482. X    the keypad) move the pointer "far" and "near", in whatever direction
  483. X    isn't available using the mouse.
  484. XSHIFT    Used to multiple-select points (just like a GUI should) in MOVE mode.
  485. XSPACE BAR    This is a commonly used key!  Since your structure can get
  486. X    very large, you may not want to refresh the screen after every
  487. X    operation, especially on a 68000 machine.  Therefore, redraw is
  488. X    triggered by the space bar so it occurs only when you want it to.
  489. X
  490. X*****************************************************************************
  491. X
  492. XOn the use of the Left and Right Mouse Buttons to select points:
  493. X
  494. XLEFT button will select the point closest to the pointer ON THE SCREEN,
  495. XRIGHT button will select the point closest IN 3D SPACE to the 3D location of
  496. X    the ED3 pointer.  This is tricky to use, but essential when you've
  497. X    got lots of points that are othogonal to the 3D axes, making the Left
  498. X    button unreliable.  I typically Rotate the structure instead, giving
  499. X    each point a unique mapping onto the screen, then use the left
  500. X    button.
  501. X
  502. X*****************************************************************************
  503. X
  504. XAbout the Author
  505. X----------------
  506. X  I dropped out of Caltech for two reasons.  First, my brain fried on the
  507. XQuantum Physics and EE (i'm a programmer, not a physicist).  Second, I was
  508. Xspending too much time with my hobby, 3D geometry, which no one was
  509. Xinterested in teaching me about.  ED3 and NU3 were projects that evolved out
  510. Xof this hobby and were written casually during a few months of unemployment
  511. Xin Berkeley in early summer 1990.  I recently revived them, added a ton
  512. Xof stuff, and released 1.0.
  513. X
  514. X  I am currently (10/17/91) employed (and reachable) at
  515. X
  516. Xpreferably: rodent@netcom.com (a public-access site)
  517. X
  518. XBen Discoe
  519. XVersasoft Corp.
  520. X4340 Almaden Expr. #110
  521. XSan Jose, CA 95118
  522. X
  523. XRead ED3.tech (and the source) for technical notes.
  524. X
  525. END_OF_FILE
  526. if test 9555 -ne `wc -c <'ed3.readme'`; then
  527.     echo shar: \"'ed3.readme'\" unpacked with wrong size!
  528. fi
  529. # end of 'ed3.readme'
  530. fi
  531. if test -f 'ed3.tech' -a "${1}" != "-c" ; then 
  532.   echo shar: Will not clobber existing file \"'ed3.tech'\"
  533. else
  534. echo shar: Extracting \"'ed3.tech'\" \(1599 characters\)
  535. sed "s/^X//" >'ed3.tech' <<'END_OF_FILE'
  536. X
  537. XED3, a primitive 3D editor for use with NU3, a primitive 3D viewer.
  538. X*******************************************************************
  539. X
  540. XThis is version 1.1.  There is a lot of work left to do.
  541. XThe program may crash, however it's not likely even if you're TRYING to crash.
  542. X
  543. Xed3 was developed with both Lattice and Aztec at different times, so it
  544. Xshouldn't matter which you use.  It wants the 2.0 header files, however, to
  545. Xtake advanced of 2.0 when it is present.
  546. X
  547. XHere are some technical matters you may be wondering about, to save you from
  548. Xhaving to slog through the source:
  549. X
  550. XED3 allocates room for points, faces, and polys dynamically, so structures
  551. Xare limited only by available ram.
  552. X
  553. XED3 does its own line clipping, which should be very stable unless you REALLY
  554. Xzoom in far.
  555. X
  556. XThe file format isn't anything standard, but rather a simple text format.
  557. XI'd like to change this, but there is no obvious standard (or more precisely,
  558. Xtoo many standards!).  If anyone knows of some nicely documented appropriate
  559. Xstandard, please let me know.
  560. X
  561. XThe undo/redo feature uses two circular buffers, one for operations and one
  562. Xfor the individual actions.
  563. X
  564. XThings needed:
  565. X
  566. X  0. The "unfold" operation should show possible "unwrappings" of polyhedra,
  567. X    much like the Dymaxion map is an "unfolded" icosahedron.  This is
  568. X    to experiment with novel ways of mapping spheres flatly.
  569. X  1. A Find-the-Convex Hull feature is needed.  The geometric algorithms
  570. X    involved are a bit hairy, but I've managed to find code that should
  571. X    work once I find time to figure it out.
  572. X  2. Some kind of portable/importable file format.
  573. X
  574. END_OF_FILE
  575. if test 1599 -ne `wc -c <'ed3.tech'`; then
  576.     echo shar: \"'ed3.tech'\" unpacked with wrong size!
  577. fi
  578. # end of 'ed3.tech'
  579. fi
  580. if test -f 'eded.p' -a "${1}" != "-c" ; then 
  581.   echo shar: Will not clobber existing file \"'eded.p'\"
  582. else
  583. echo shar: Extracting \"'eded.p'\" \(2920 characters\)
  584. sed "s/^X//" >'eded.p' <<'END_OF_FILE'
  585. X/* Prototypes for functions defined in eded.c */
  586. Xvoid main(int argc,
  587. X          char **argv);
  588. Xvoid del_selected(void);
  589. Xvoid del_selected_points(int assume_loose);
  590. Xvoid del_point(index p,
  591. X               int assume_loose,
  592. X               int silent);
  593. Xvoid convert_to_xyz(pixel pixx,
  594. X                    pixel pixy);
  595. Xvoid convert_to_xy(coord x,
  596. X                   coord y,
  597. X                   coord z);
  598. Xvoid convert_points(void);
  599. Xvoid convert_point(register uindex p);
  600. Xvoid convert_point_sub(register EdPoint *edp);
  601. Xvoid allocate_arrays(void);
  602. Xindex more_faces(uindex new_faces);
  603. Xindex more_polys(uindex new_polys);
  604. Xindex more_points(uindex new_poi);
  605. Xvoid free_arrays(void);
  606. Xvoid new(void);
  607. Xvoid start_face(uindex p);
  608. Xvoid start_poly(uindex p);
  609. Xvoid start_to_kill_face(uindex p);
  610. Xvoid start_to_kill_poly(uindex p);
  611. Xindex select_point(uindex p);
  612. Xvoid deselect_point(uindex p);
  613. Xvoid duplicate(char do_faces);
  614. Xvoid duplicate0(char do_faces);
  615. Xindex add_point(coord x,
  616. X                coord y,
  617. X                coord z);
  618. Xindex add_point0(coord x,
  619. X                 coord y,
  620. X                 coord z);
  621. Xvoid insert_point(index where,
  622. X                  coord x,
  623. X                  coord y,
  624. X                  coord z);
  625. Xvoid add_face1(int p0,
  626. X               int p1,
  627. X               int p2);
  628. Xvoid add_face(uindex p0,
  629. X              uindex p1,
  630. X              uindex p2,
  631. X              short fcol,
  632. X              int silent);
  633. Xvoid add_face0(uindex p0,
  634. X               uindex p1,
  635. X               uindex p2,
  636. X               short fcol);
  637. Xvoid insert_face(index where,
  638. X                 uindex p0,
  639. X                 uindex p1,
  640. X                 uindex p2,
  641. X                 short fcol);
  642. Xvoid add_poly(index n,
  643. X              short pcol,
  644. X              index *array,
  645. X              int silent);
  646. Xvoid allocate_poly(uindex verts,
  647. X                   short pcol);
  648. Xvoid finish_poly(int silent);
  649. Xvoid insert_poly(index where,
  650. X                 index verts,
  651. X                 index *array,
  652. X                 short col);
  653. Xvoid delete_point(index p);
  654. Xvoid delete_point0(index p);
  655. Xvoid delete_face(register uindex f,
  656. X                 int silent);
  657. Xvoid delete_poly(register uindex q,
  658. X                 int silent);
  659. Xvoid kill_poly(register uindex p);
  660. Xvoid del_selected_faces(int just_count,
  661. X                        index *faces_del,
  662. X                        index *polys_del,
  663. X                        index *max_verts);
  664. Xvoid insert_vertex(index q,
  665. X                   char vert,
  666. X                   index p0,
  667. X                   int silent);
  668. Xvoid delete_vertex(index q,
  669. X                   unsigned char vert,
  670. X                   int silent);
  671. Xvoid poly_to_face(index q,
  672. X                  int silent);
  673. Xindex find_nearest_on_screen(pixel pixx,
  674. X                             pixel pixy,
  675. X                             index avoid_p);
  676. Xindex find_nearest_in_space(coord fx,
  677. X                            coord fy,
  678. X                            coord fz,
  679. X                            index avoid_p);
  680. END_OF_FILE
  681. if test 2920 -ne `wc -c <'eded.p'`; then
  682.     echo shar: \"'eded.p'\" unpacked with wrong size!
  683. fi
  684. # end of 'eded.p'
  685. fi
  686. if test -f 'edgr.p' -a "${1}" != "-c" ; then 
  687.   echo shar: Will not clobber existing file \"'edgr.p'\"
  688. else
  689. echo shar: Extracting \"'edgr.p'\" \(1172 characters\)
  690. sed "s/^X//" >'edgr.p' <<'END_OF_FILE'
  691. X/* Prototypes for functions defined in edgr.c */
  692. Xvoid draw_3d(void);
  693. Xvoid toggle_dragged_points(void);
  694. Xvoid add_segment(uindex p);
  695. Xvoid del_face(index f,
  696. X              int silent);
  697. Xvoid del_poly(index q,
  698. X              int silent);
  699. Xvoid kill_segment(uindex p);
  700. Xvoid distance_tool(char buttons,
  701. X                   index current_p);
  702. Xvoid finish_move(void);
  703. Xvoid start_moving_point(int buttons,
  704. X                        uindex p);
  705. Xvoid draw_points(char clear);
  706. Xvoid draw_point(register uindex p,
  707. X                int pcol);
  708. Xvoid draw_point_sub(EdPoint *p);
  709. Xvoid draw_hair(void);
  710. Xvoid draw_distance_tool(void);
  711. Xvoid redraw_newface(void);
  712. Xvoid draw_faces(char clear);
  713. Xvoid draw_face_color(uindex f,
  714. X                     int col);
  715. Xvoid draw_face(uindex f);
  716. Xvoid draw_poly_color(uindex q,
  717. X                     short col);
  718. Xvoid draw_poly(uindex p);
  719. Xvoid draw_rot(void);
  720. Xvoid draw_bars(void);
  721. Xvoid show_counts(void);
  722. Xvoid draw_coords(int erase);
  723. Xvoid draw_distance(void);
  724. Xvoid box_point(register uindex p);
  725. Xvoid tri_up_point(register uindex p);
  726. Xvoid tri_down_point(register uindex p);
  727. Xvoid clip_draw(register uindex p0,
  728. X               register uindex p1);
  729. Xvoid screen_say(char *str);
  730. END_OF_FILE
  731. if test 1172 -ne `wc -c <'edgr.p'`; then
  732.     echo shar: \"'edgr.p'\" unpacked with wrong size!
  733. fi
  734. # end of 'edgr.p'
  735. fi
  736. if test -f 'edio.p' -a "${1}" != "-c" ; then 
  737.   echo shar: Will not clobber existing file \"'edio.p'\"
  738. else
  739. echo shar: Extracting \"'edio.p'\" \(867 characters\)
  740. sed "s/^X//" >'edio.p' <<'END_OF_FILE'
  741. X/* Prototypes for functions defined in edio.c */
  742. Xvoid handle_gadget(int id);
  743. Xvoid mouse_down(char buttons);
  744. Xvoid mouse_up(void);
  745. Xvoid update_movement(coord newx,
  746. X                     coord newy);
  747. Xvoid handle_key(short key);
  748. Xvoid handle_menu(int menunum,
  749. X                 int itemnum,
  750. X                 int flags);
  751. Xvoid handle_project(int itemnum);
  752. Xvoid handle_edit(int itemnum,
  753. X                 int mflags);
  754. Xvoid handle_polyhedra(int itemnum);
  755. Xvoid handle_special(int itemnum);
  756. Xvoid handle_options(int itemnum,
  757. X                    USHORT mflags);
  758. Xvoid add_all_menus(void);
  759. Xvoid add_all_gadgets(void);
  760. Xint save_data(char *fname);
  761. Xint load_data(char *fname);
  762. Xvoid get_undo_bufsize(void);
  763. Xint tell_user_overflow(void);
  764. Xint tell_user_changes(void);
  765. Xvoid about_help(void);
  766. Xvoid save_request(void);
  767. Xvoid load_request(void);
  768. Xint save_defaults(void);
  769. Xint load_defaults(void);
  770. END_OF_FILE
  771. if test 867 -ne `wc -c <'edio.p'`; then
  772.     echo shar: \"'edio.p'\" unpacked with wrong size!
  773. fi
  774. # end of 'edio.p'
  775. fi
  776. if test -f 'edsysdef.h' -a "${1}" != "-c" ; then 
  777.   echo shar: Will not clobber existing file \"'edsysdef.h'\"
  778. else
  779. echo shar: Extracting \"'edsysdef.h'\" \(145 characters\)
  780. sed "s/^X//" >'edsysdef.h' <<'END_OF_FILE'
  781. X/*
  782. X    edsysdef.h
  783. X    Amiga
  784. X*/
  785. X
  786. X#define PROTOS 1        /* set if compiler supports prototypes */
  787. X#define DISP_COLOR 1    /* set if there is a color display */
  788. END_OF_FILE
  789. if test 145 -ne `wc -c <'edsysdef.h'`; then
  790.     echo shar: \"'edsysdef.h'\" unpacked with wrong size!
  791. fi
  792. # end of 'edsysdef.h'
  793. fi
  794. if test -f 'edtypes.h' -a "${1}" != "-c" ; then 
  795.   echo shar: Will not clobber existing file \"'edtypes.h'\"
  796. else
  797. echo shar: Extracting \"'edtypes.h'\" \(3665 characters\)
  798. sed "s/^X//" >'edtypes.h' <<'END_OF_FILE'
  799. X/*
  800. X    edtypes.h
  801. X    types used by ed3
  802. X
  803. X09-25-91 add structures for actions
  804. X09-09-91 add Colors
  805. X*/
  806. X
  807. X#if INTEGER
  808. X  typedef short coord;
  809. X  #define zero 0
  810. X#else
  811. X  typedef double coord;
  812. X  #define zero 0.0
  813. X#endif
  814. X
  815. Xtypedef short index;    /* used to index all arrays */
  816. X#define POLYFLAG    0x80    /* high bit of index type */
  817. X
  818. X/* Lattice won't let me say "unsigned index", so i need: */
  819. Xtypedef unsigned short uindex;
  820. Xtypedef short pixel;    /* used for all screen coordinates */
  821. X
  822. Xtypedef struct    /* Describes one 3D point */
  823. X{
  824. X    coord x, y, z;    /* simple as can be */
  825. X} Point3D;
  826. X
  827. Xtypedef struct    /* Describes one 3D vector */
  828. X{
  829. X    coord x, y, z;
  830. X} Vector3D;
  831. X
  832. Xtypedef struct    /* Describes one point used by the editor */
  833. X{
  834. X    coord x, y, z;    /* in global 3D space */
  835. X    pixel px, py;    /* on the screen */
  836. X    short code;        /* clipping codes and flags */
  837. X} EdPoint;
  838. X
  839. Xtypedef struct    /* Describes one face    */
  840. X{
  841. X    uindex p[3];    /* three points the face connects */
  842. X    unsigned short color;
  843. X} Face;
  844. X
  845. Xtypedef struct    /* Describes one multi-sided polygon, >3 sides */
  846. X{
  847. X    uindex *p;        /* pointer to start of point array */
  848. X    unsigned short verts;    /* number of vertices */
  849. X    unsigned short color;
  850. X} Polygon;
  851. X
  852. Xtypedef struct
  853. X{
  854. X    short attached;    /* flag: attached to a point or not? */
  855. X    uindex p;        /* which point it is attached to */
  856. X    coord x, y, z;    /* endpoint if not attached */
  857. X} EndPoint;
  858. X
  859. Xtypedef struct
  860. X{
  861. X    unsigned short offset;
  862. X    unsigned short actions;
  863. X} Operation;
  864. X
  865. Xtypedef struct
  866. X{
  867. X    char type;
  868. X    coord x, y, z;
  869. X} a_add_p;
  870. X
  871. Xtypedef struct
  872. X{
  873. X    char type;
  874. X    coord x, y, z;
  875. X    index number;
  876. X} a_del_p;
  877. X
  878. Xtypedef struct
  879. X{
  880. X    char type;
  881. X    short color;
  882. X    index p0, p1, p2;
  883. X} a_add_f;
  884. X
  885. Xtypedef struct
  886. X{
  887. X    char type;
  888. X    short color;
  889. X    index p0, p1, p2;
  890. X    index number;
  891. X} a_del_f;
  892. X
  893. Xtypedef struct
  894. X{
  895. X    char type;
  896. X    char points;
  897. X    short color;
  898. X    index p[MAX_EDGES];
  899. X} a_add_q;
  900. X
  901. Xtypedef struct
  902. X{
  903. X    char type;
  904. X    char points;
  905. X    index number;
  906. X    short color;
  907. X    index p[MAX_EDGES];
  908. X} a_del_q;
  909. X
  910. X#define MAX_ACTION_SIZE sizeof(a_del_q)    /* the largest structure */
  911. X
  912. Xtypedef struct
  913. X{
  914. X    char type;
  915. X    index p0;
  916. X    coord dx, dy, dz;
  917. X} a_move_p;
  918. X
  919. Xtypedef struct
  920. X{
  921. X    char type;
  922. X    char changes;
  923. X    index p0, p1;
  924. X    index changed[MAX_EDGES];    /* each entry may e a flag or poly */
  925. X    /* polys are flagged with the POLYFLAG bit set */
  926. X} a_join_p;
  927. X
  928. Xtypedef struct
  929. X{
  930. X    char type;
  931. X    char vert;    /* index, not number of verts */
  932. X    index q;    /* poly */
  933. X    index p0;    /* point # removed */
  934. X} a_del_v;
  935. X
  936. Xtypedef struct
  937. X{
  938. X    char type;
  939. X    index q;    /* poly */
  940. X} a_morph_q;
  941. X
  942. Xunion Action
  943. X{
  944. X  a_add_p add_p;
  945. X  a_del_p del_p;
  946. X  a_add_f add_f;
  947. X  a_del_f del_f;
  948. X  a_add_q add_q;
  949. X  a_del_q del_q;
  950. X  a_move_p move_p;
  951. X};
  952. X
  953. Xtypedef struct
  954. X{
  955. X    char assume_poly; /* Tells the geometric operators to assume we are
  956. X                            working with a polyhedron */
  957. X    char copy_made;
  958. X    char crosshair;        /* display crosshair? */
  959. X    char debug;
  960. X    char display_dtool;
  961. X    char display_type;    /* appear on workbench? etc. */
  962. X    char drag_dtool;    /* set when we are actively dragging the dtool */
  963. X    char exclusive_del;    /* delete only the faces which have ALL points selected */
  964. X    char faces_only;    /* Edit operations apply to faces/polys only */
  965. X    char in_edit_area;    /* set when the pointer is in the editing area */
  966. X    char moving_points;
  967. X    char points_only;    /* Edit operations apply to points only */
  968. X    char rotate_all;    /* Rotate will affect ALL points */
  969. X    char shape;            /* either M_FACE or M_POLY */
  970. X    char show_coords;    /* display coordinates? */
  971. X    char which_end;        /* which end of the dtool are we dragging? */
  972. X    char undo_active;    /* set if the undo buffer is active */
  973. X} Flags;
  974. X
  975. X/* to remember the colors of various display elements */
  976. X
  977. Xtypedef struct
  978. X{
  979. X    char titlea;
  980. X    char titleb;
  981. X    char box;
  982. X    char point;
  983. X    char face;
  984. X    char erase;
  985. X    char newface;
  986. X} Colors;
  987. X
  988. X
  989. END_OF_FILE
  990. if test 3665 -ne `wc -c <'edtypes.h'`; then
  991.     echo shar: \"'edtypes.h'\" unpacked with wrong size!
  992. fi
  993. # end of 'edtypes.h'
  994. fi
  995. if test -f 'edvan.p' -a "${1}" != "-c" ; then 
  996.   echo shar: Will not clobber existing file \"'edvan.p'\"
  997. else
  998. echo shar: Extracting \"'edvan.p'\" \(2290 characters\)
  999. sed "s/^X//" >'edvan.p' <<'END_OF_FILE'
  1000. X/* Prototypes for functions defined in edvan.c */
  1001. Xvoid center_to_origin(void);
  1002. Xvoid reset_zoom(void);
  1003. Xvoid move_point_rel(index p,
  1004. X                    coord dx,
  1005. X                    coord dy,
  1006. X                    coord dz);
  1007. Xvoid move_point_to(index p,
  1008. X                   coord x,
  1009. X                   coord y,
  1010. X                   coord z);
  1011. Xvoid refresh_all(void);
  1012. Xvoid toggle_dtool(void);
  1013. Xvoid select_all(void);
  1014. Xvoid deselect_all(void);
  1015. Xvoid select_connected(index starting_point);
  1016. Xvoid deselect_connected(index starting_point);
  1017. Xvoid toggle_select(int buttons,
  1018. X                   index tp);
  1019. Xvoid glue(index nearest);
  1020. Xvoid glue_points(int p0,
  1021. X                 int p1);
  1022. Xvoid unfold(void);
  1023. Xvoid stellate(void);
  1024. Xvoid stellate0(int stellar_mag,
  1025. X               int rel_to);
  1026. Xvoid find_dual(void);
  1027. Xint dual_ok(void);
  1028. Xindex adjacent_xx(uindex qf0,
  1029. X                  uindex qf1,
  1030. X                  int poly_flag0,
  1031. X                  int poly_flag1);
  1032. Xindex adjacent_ff(uindex f0,
  1033. X                  uindex f1);
  1034. Xindex adjacent_fp(uindex f0,
  1035. X                  uindex q0);
  1036. Xindex adjacent_pp(uindex q0,
  1037. X                  uindex q1);
  1038. Xindex points_are_a_face(uindex ps0,
  1039. X                        uindex ps1,
  1040. X                        uindex ps2);
  1041. Xindex face_next_to_edge(uindex ps0,
  1042. X                        uindex ps1,
  1043. X                        index avoid_f);
  1044. Xindex point_is_on_a_face(uindex ps0);
  1045. Xindex point_is_on_a_poly(uindex ps0);
  1046. Xindex points_are_on_a_poly(uindex *array,
  1047. X                           uindex verts);
  1048. Xindex poly_next_to_edge(uindex ps0,
  1049. X                        uindex ps1,
  1050. X                        index avoid_p);
  1051. Xvoid zoom(int buttons);
  1052. Xvoid set_rot_axis(coord x,
  1053. X                  coord y,
  1054. X                  coord z);
  1055. Xvoid rotate(void);
  1056. Xvoid rotate_point(index p,
  1057. X                  double co,
  1058. X                  double si);
  1059. Xvoid find_center(double *cx,
  1060. X                 double *cy,
  1061. X                 double *cz);
  1062. Xvoid find_radius(double cx,
  1063. X                 double cy,
  1064. X                 double cz,
  1065. X                 double *radius);
  1066. Xunsigned long isqrt(unsigned long v);
  1067. Xint fibo(int n);
  1068. Xvoid set_clockwisdom(void);
  1069. Xint determine_clockwisdom(index p0,
  1070. X                          index p1,
  1071. X                          index p2);
  1072. Xvoid change_face_clockwisdom(index f);
  1073. Xvoid change_poly_clockwisdom(index q);
  1074. END_OF_FILE
  1075. if test 2290 -ne `wc -c <'edvan.p'`; then
  1076.     echo shar: \"'edvan.p'\" unpacked with wrong size!
  1077. fi
  1078. # end of 'edvan.p'
  1079. fi
  1080. if test -f 'freq.p' -a "${1}" != "-c" ; then 
  1081.   echo shar: Will not clobber existing file \"'freq.p'\"
  1082. else
  1083. echo shar: Extracting \"'freq.p'\" \(104 characters\)
  1084. sed "s/^X//" >'freq.p' <<'END_OF_FILE'
  1085. X/* Prototypes for functions defined in freq.c */
  1086. Xvoid frequency(void);
  1087. Xint bucky_frequency(short freq);
  1088. END_OF_FILE
  1089. if test 104 -ne `wc -c <'freq.p'`; then
  1090.     echo shar: \"'freq.p'\" unpacked with wrong size!
  1091. fi
  1092. # end of 'freq.p'
  1093. fi
  1094. if test -f 'sysdefed.h' -a "${1}" != "-c" ; then 
  1095.   echo shar: Will not clobber existing file \"'sysdefed.h'\"
  1096. else
  1097. echo shar: Extracting \"'sysdefed.h'\" \(146 characters\)
  1098. sed "s/^X//" >'sysdefed.h' <<'END_OF_FILE'
  1099. X/*
  1100. X    sysdefed.h
  1101. X    Amiga
  1102. X*/
  1103. X
  1104. X#define PROTOS 1        /* set if compiler supports prototypes */
  1105. X#define DISP_COLOR 1    /* set if there is a color display */
  1106. X
  1107. END_OF_FILE
  1108. if test 146 -ne `wc -c <'sysdefed.h'`; then
  1109.     echo shar: \"'sysdefed.h'\" unpacked with wrong size!
  1110. fi
  1111. # end of 'sysdefed.h'
  1112. fi
  1113. if test -f 'sysgr.h' -a "${1}" != "-c" ; then 
  1114.   echo shar: Will not clobber existing file \"'sysgr.h'\"
  1115. else
  1116. echo shar: Extracting \"'sysgr.h'\" \(815 characters\)
  1117. sed "s/^X//" >'sysgr.h' <<'END_OF_FILE'
  1118. X/* includes for an ed3 module that uses the graphics library */
  1119. X
  1120. X#include <exec/types.h>
  1121. X#include <graphics/gfxmacros.h>
  1122. X#include <graphics/rastport.h>
  1123. X
  1124. X#ifdef LATTICE
  1125. X#include <proto/graphics.h>
  1126. X#else
  1127. X#include <functions.h>
  1128. X#define PI   3.14159265358979323846
  1129. X#define PID2 1.57079632679489661923    /* PI/2 */
  1130. X#define PID4 0.78539816339744830962    /* PI/4 */
  1131. X#endif
  1132. X
  1133. X#include <stdio.h>
  1134. X#include <math.h>
  1135. X
  1136. X#include "ed3.h"    /* funtion defs, #defines, typedefs */
  1137. Xextern struct RastPort *rp;
  1138. X
  1139. X#define m_move(x, y) Move(rp, x, y)
  1140. X#define m_draw(x, y) Draw(rp, x, y)
  1141. X#define m_setpen1(c) SetAPen(rp, c)
  1142. X#define m_setpen2(c) SetBPen(rp, c)
  1143. X#define m_setmode(m) SetDrMd(rp, m)
  1144. X#define m_text(t, l) Text(rp, t, l)
  1145. X#define m_rectfill(x0, y0, x1, y1) RectFill(rp, x0, y0, x1, y1)
  1146. X
  1147. X#define dm_norm    JAM2
  1148. X#define dm_comp COMPLEMENT
  1149. END_OF_FILE
  1150. if test 815 -ne `wc -c <'sysgr.h'`; then
  1151.     echo shar: \"'sysgr.h'\" unpacked with wrong size!
  1152. fi
  1153. # end of 'sysgr.h'
  1154. fi
  1155. if test -f 'sysgr.p' -a "${1}" != "-c" ; then 
  1156.   echo shar: Will not clobber existing file \"'sysgr.p'\"
  1157. else
  1158. echo shar: Extracting \"'sysgr.p'\" \(2088 characters\)
  1159. sed "s/^X//" >'sysgr.p' <<'END_OF_FILE'
  1160. X/* Prototypes for functions defined in sysgr.c */
  1161. Xvoid open_stuff(short depth,
  1162. X                char *title);
  1163. Xvoid setup_for_workbench(struct Screen *wbdata);
  1164. Xvoid setup_for_custom_screen(int depth,
  1165. X                             char *title);
  1166. Xvoid sys_attach_menus(void);
  1167. Xvoid sys_refresh_gadgets(void);
  1168. Xvoid add_gadget(char *string,
  1169. X                int gflags);
  1170. Xvoid add_boolean_gadget(struct Window *wind,
  1171. X                        int x,
  1172. X                        int y,
  1173. X                        int width,
  1174. X                        char *string,
  1175. X                        int gflags,
  1176. X                        int id,
  1177. X                        int draw);
  1178. Xvoid add_long_gadget(struct Window *wind,
  1179. X                     int x,
  1180. X                     int y,
  1181. X                     int width,
  1182. X                     long value,
  1183. X                     int id,
  1184. X                     int draw);
  1185. Xstruct Border *create_shadow_border(int width,
  1186. X                                    int height,
  1187. X                                    int inside);
  1188. Xvoid add_menu(char *name);
  1189. Xstruct MenuItem *add_menu_item(int menu_num,
  1190. X                               char *name,
  1191. X                               int mflags,
  1192. X                               char shortcut);
  1193. Xvoid toggle_menuitem(int which_menu,
  1194. X                     int which_item);
  1195. Xvoid sys_exit(char *s);
  1196. Xvoid enable_menus(char on);
  1197. Xvoid wait_for_message(void);
  1198. Xvoid handle_messages(void);
  1199. Xvoid sys_handle_menu(unsigned short menu_number);
  1200. Xvoid *sys_alloc(unsigned int size);
  1201. Xvoid sys_free(void *ptr,
  1202. X              unsigned int size);
  1203. Xchar *sys_file_requestor(char *title,
  1204. X                         char *showpattern);
  1205. Xvoid sys_window(int cols,
  1206. X                int rows,
  1207. X                char *title);
  1208. Xvoid sys_close_window(void);
  1209. Xvoid sys_say_text(char *str);
  1210. Xvoid sys_get_long(long value,
  1211. X                  int id);
  1212. Xvoid sys_boolean(char *string,
  1213. X                 int id);
  1214. Xvoid sys_activate(int id);
  1215. Xvoid sys_movecur(int col,
  1216. X                 int row);
  1217. Xint sys_read_event(int *id,
  1218. X                   long *data);
  1219. Xvoid *mem_alloc(long bytes);
  1220. Xvoid clear_remember(int to_where);
  1221. END_OF_FILE
  1222. if test 2088 -ne `wc -c <'sysgr.p'`; then
  1223.     echo shar: \"'sysgr.p'\" unpacked with wrong size!
  1224. fi
  1225. # end of 'sysgr.p'
  1226. fi
  1227. if test -f 'sysnogr.h' -a "${1}" != "-c" ; then 
  1228.   echo shar: Will not clobber existing file \"'sysnogr.h'\"
  1229. else
  1230. echo shar: Extracting \"'sysnogr.h'\" \(369 characters\)
  1231. sed "s/^X//" >'sysnogr.h' <<'END_OF_FILE'
  1232. X/* includes for an ed3 module that don't use the graphics library */
  1233. X
  1234. X#include <exec/types.h>
  1235. X#include <exec/memory.h>
  1236. X#include <stdio.h>
  1237. X
  1238. X#ifdef LATTICE
  1239. X#include <math.h>
  1240. X#else
  1241. X#include <math.h>
  1242. X#define PI   3.14159265358979323846
  1243. X#define PID2 1.57079632679489661923    /* PI/2 */
  1244. X#define PID4 0.78539816339744830962    /* PI/4 */
  1245. X#endif
  1246. X
  1247. X#define HELPKEY    
  1248. X
  1249. X#include "ed3.h"
  1250. END_OF_FILE
  1251. if test 369 -ne `wc -c <'sysnogr.h'`; then
  1252.     echo shar: \"'sysnogr.h'\" unpacked with wrong size!
  1253. fi
  1254. # end of 'sysnogr.h'
  1255. fi
  1256. if test -f 'undo.p' -a "${1}" != "-c" ; then 
  1257.   echo shar: Will not clobber existing file \"'undo.p'\"
  1258. else
  1259. echo shar: Extracting \"'undo.p'\" \(1453 characters\)
  1260. sed "s/^X//" >'undo.p' <<'END_OF_FILE'
  1261. X/* Prototypes for functions defined in undo.c */
  1262. Xint enough_room(index p,
  1263. X                index f,
  1264. X                index q,
  1265. X                index dp,
  1266. X                index df,
  1267. X                index dq,
  1268. X                index mp,
  1269. X                int max_verts);
  1270. Xvoid undo(void);
  1271. Xvoid undo_action(unsigned short offset);
  1272. Xvoid change_facet(index p0,
  1273. X                  index p1,
  1274. X                  index i1);
  1275. Xvoid redo(void);
  1276. Xvoid redo_action(unsigned short offset);
  1277. Xunsigned short size_of_action(unsigned short offset);
  1278. Xvoid action_add_p(coord x,
  1279. X                  coord y,
  1280. X                  coord z);
  1281. Xvoid action_del_p(index p,
  1282. X                  coord x,
  1283. X                  coord y,
  1284. X                  coord z);
  1285. Xvoid action_add_f(index p0,
  1286. X                  index p1,
  1287. X                  index p2,
  1288. X                  int col);
  1289. Xvoid action_del_f(index f);
  1290. Xvoid action_add_q(int points,
  1291. X                  index *p,
  1292. X                  int col);
  1293. Xvoid action_del_q(index q);
  1294. Xvoid action_move_p(index p,
  1295. X                   coord dx,
  1296. X                   coord dy,
  1297. X                   coord dz);
  1298. Xvoid action_join_p(index p0,
  1299. X                   index p1,
  1300. X                   index *changed,
  1301. X                   index changes);
  1302. Xvoid action_del_v(index q,
  1303. X                  char vert,
  1304. X                  index p0);
  1305. Xvoid action_morph_q(index q);
  1306. Xvoid make_room(void);
  1307. Xvoid delete_oldest_operation(void);
  1308. Xvoid init_undo(void);
  1309. Xvoid begin_operation(void);
  1310. Xvoid end_operation(void);
  1311. END_OF_FILE
  1312. if test 1453 -ne `wc -c <'undo.p'`; then
  1313.     echo shar: \"'undo.p'\" unpacked with wrong size!
  1314. fi
  1315. # end of 'undo.p'
  1316. fi
  1317. echo shar: End of archive 1 \(of 6\).
  1318. cp /dev/null ark1isdone
  1319. MISSING=""
  1320. for I in 1 2 3 4 5 6 ; do
  1321.     if test ! -f ark${I}isdone ; then
  1322.     MISSING="${MISSING} ${I}"
  1323.     fi
  1324. done
  1325. if test "${MISSING}" = "" ; then
  1326.     echo You have unpacked all 6 archives.
  1327.     rm -f ark[1-9]isdone
  1328. else
  1329.     echo You still need to unpack the following archives:
  1330.     echo "        " ${MISSING}
  1331. fi
  1332. ##  End of shell archive.
  1333. exit 0
  1334. -- 
  1335. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1336. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1337. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  1338.